﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

using MobileGIS.Carto.Layers;
using MobileGIS.Carto;
using MobileGIS.Data;
using MobileGIS.Geometries;
using MobileGIS.Styles;


namespace MobileGIS.UI
{
    public partial class MapControl2 : UserControl,IDisplay
    {
        private Bitmap m_bmpBufferImage = null;
        private Graphics m_BufferGraphics = null;
        private Graphics m_surfaceGraphics = null;

        public MapControl2()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 获取或设置地图对象
        /// </summary>
        public Map Map { get; set; }


        public void ReDraw()
        {
            for (int i = 0; i < this.Map.Layers.Count; i++)
            {
            }
        }


        #region IDisplay Members

        public Point MapToScreen(double x, double y)
        {
            throw new NotImplementedException();
        }

        public Point2D ScreenToMap(int x, int y)
        {
            throw new NotImplementedException();
        }

        public double HorizontalResolution
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public double VerticalResolution
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }

        public Graphics Graphic
        {
            get
            {
                throw new NotImplementedException();
            }
            set
            {
                throw new NotImplementedException();
            }
        }


        public BoundingBox View { get; set; }

        public void DrawLayer(FeatureLayer layer)
        {
            List<Geometry> geoms = layer.DataSource.GetGeometriesInView(this.View);
        }

       

        public void DrawPoint(double x, double y,  SolidBrush brush, int offx, int offy, int size  )
        {
            Point xy = this.MapToScreen(x, y);
            this.DrawPoint(brush, xy.X + offx, xy.Y + offy, size);
        }

        public void DrawLine(double x1, double y1, double x2, double y2, Pen linePen)
        {

        }

        public void DrawPoint(SolidBrush brush, int x, int y, int size )
        {
            
        }

        public void DrawLines(Pen pen, Point[] pts)
        {
            
        }

        public void DrawPolygon(Pen pen, Brush fillBrush, Point[] pts)
        {
            
        }

        #endregion
    }
}
